package reflect;

import reflect.annotations.AutoRunClass;
import reflect.annotations.AutoRunMethod;

@AutoRunClass(5)
public class Person {
    private String name= "张三";
    private  int age;

    public Person() {
    }

    public Person( String name, int age) {
        this.name = name;
        this.age = age;
    }
    @AutoRunMethod(value = 2,name="你好")
    public void sayHello(){System.out.println(name+":hello!");}
    public void sayHi(){
        System.out.println(name+":hi!");
    }
    public void sayGoodbye(){System.out.println(name+":bye!");}
    @AutoRunMethod(name="哈哈",value = 3)
    public void watchTV(){
        System.out.println(name+":看电视");
    }
    @AutoRunMethod(name="value为默认值")
    public void playGame(){
        System.out.println(name+":玩游戏");
    }
    public void say(String info){
        System.out.println(name+":"+info);
    }

    public void say(String info,int count){
        for (int i=0;i<count;i++) {
            System.out.println(name+":"+info);
        }
    }
    private void sasa(){
        System.out.println("你要干啥  别访问");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
